package com.itheima.service;

import com.itheima.dao.GoodsDao;
import com.itheima.domain.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author 32803
 */

@PropertySource(value = "classpath:jdbc.properties", encoding = "UTF-8")
@Component("goodsService")
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsDao goodsDao;

    @Value("${jdbc.username}")
    private String name;

    public void setGoodsDao(GoodsDao goodsDao) {
        this.goodsDao = goodsDao;
    }

    @Override
    public Map<String, Object> select1(Map<String, Object> condition) {
        return goodsDao.select1(condition);
    }

    @Override
    public List<Goods> select4(String goodsName) {
        return goodsDao.select4(goodsName);
    }
}
